package com.pubinfo.passbook.data.controller.bill;

import com.pubinfo.passbook.common.model.vo.base.JsonResult;
import com.pubinfo.passbook.data.quartz.service.ManualInvoiceReimbursement;
import com.pubinfo.passbook.data.quartz.service.MedicineOnJobOrRetireAutoReimbursement;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "reimbursement")
@Api(tags = "自动报账管理")
@Slf4j
public class AutoReimbursementController {
  @Autowired
  MedicineOnJobOrRetireAutoReimbursement autoReimbursement;
  
  @Autowired
  ManualInvoiceReimbursement reimbursement;
  
  @PostMapping("autoReimbursement")
  @ApiOperation(value = "医药费票据自动报账")
  public JsonResult<String> autoReimbursement(@RequestBody List<String> eInvoiceIds) {
    
    return autoReimbursement.autoReimbursement(eInvoiceIds);
  }
  
  @PostMapping("autoManualReimbursement")
  @ApiOperation(value = "医药费单据自动报账")
  public void autoManualReimbursement(@RequestBody List<String> ids) {
    reimbursement.autoManualReimbursement(ids);
  }
}
